home *** CD-ROM | disk | FTP | other *** search
Verilog source code | 1992-06-18 | 369 b | 23 lines | [TEXT/MPS ] |
- module regfile(clock, in_addr, in,
- out1_addr, out1,
- out2_addr, out2);
-
- input clock;
- input [31: 0]in;
- input [ 4: 0]in_addr,
- out1_addr,
- out2_addr;
-
- output [31: 0]out1,
- out2;
-
- reg [31: 0]r[32];
-
- assign out1 = r[out1_addr];
-
- assign out2 = r[out2_addr];
-
- always @(negedge clock)
- r[in_addr] = in;
-
- endmodule